<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="md5/md5.js"></script>
	<style type="text/css">
	</style>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#submit").click(function(){
				var form = document.getElementById("addForm");
				$.ajax({
					url:"/api/user/favorite/add",
					//url:"http://10.10.62.117:8080/login?api_login=true",
					//url:"http://127.0.0.1:8088/cas/api/account/checklogin",
					type:"POST",
					data:$("#addForm").serialize(),
					success:function(r){
						//console.log(r);
						alert(r.message);
						//alert(r.data.SESSION_TOKEN);
					}
				});
			});
			$("#readsubmit").click(function(){
				var form = document.getElementById("feedReadForm");
				$.ajax({
					url:"/api/feed/read",
					//url:"http://10.10.62.117:8080/login?api_login=true",
					//url:"http://127.0.0.1:8088/cas/api/account/checklogin",
					type:"POST",
					data:$("#feedReadForm").serialize(),
					success:function(r){
						//console.log(r);
						alert(r.message);
						//alert(r.data.SESSION_TOKEN);
					}
				});
			});
			$("#deletesubmit").click(function(){
				var form = document.getElementById("deleteForm");
				$.ajax({
					url:"/api/user/favorite/delete",
					//url:"http://10.10.62.117:8080/login?api_login=true",
					//url:"http://127.0.0.1:8088/cas/api/account/checklogin",
					type:"POST",
					data:$("#deleteForm").serialize(),
					success:function(r){
						//console.log(r);
						alert(r.message);
						//alert(r.data.SESSION_TOKEN);
					}
				});
			});
			$("#querysubmit").click(function(){
				var form = document.getElementById("queryForm");
				$.ajax({
					url:"/api/user/favorite/get_list",
					//url:"http://10.10.62.117:8080/login?api_login=true",
					//url:"http://127.0.0.1:8088/cas/api/account/checklogin",
					type:"GET",
					data:$("#queryForm").serialize(),
					datatype:"text",
					success:function(r){
						//console.log(r);
						//alert(r.data.SESSION_TOKEN);
						$("#resultTextarea").html( JSON.stringify(r));
					}
				});
			});
		});
		function doAjax(method,url,parm){
			$.ajax({
				url:url,
				type:method,
				data:parm,
				success:function(r){
					console.log(r);
					$("#resultTextarea").val(JSON.stringify(r));
				},
				error:function(XMLHttpRequest, textStatus, errorThrown){
					console.log(XMLHttpRequest.responseText);
					$("#resultTextarea").val(XMLHttpRequest.responseText);
				}
			});
		}
		function doJsonAjax(method,url,parm){
			$.ajax({
				url:url,
				type:method,
				contentType:"application/json",
				data:JSON.stringify(parm),
				success:function(r){
					console.log(r);
					$("#resultTextarea").val(JSON.stringify(r));
				},
				error:function(XMLHttpRequest, textStatus, errorThrown){
					console.log(XMLHttpRequest.responseText);
					$("#resultTextarea").val(XMLHttpRequest.responseText);
				}
			});
		}
	</script>
</head>
<style type="text/css">
.table{
	border-collapse:collapse;
	width:700px;
}
.table td,.table th{
	border:1px solid #ccc;
}
</style>
<body>
<fieldset>
   <legend>新增常用联系人</legend>
   <form id="addForm" method="post">
		联系人UserId：<input type="text" name="ids" value=""></input>
		联系人UserId：<input type="text" name="ids" value=""></input>
		联系人UserId：<input type="text" name="ids" value=""></input>
		联系人UserId：<input type="text" name="ids" value=""></input>
		<input id="submit" type="button" value="新增"></input>
	</form>
</fieldset>
<fieldset>
   <legend>常用联系人</legend>
   <form id="queryForm" method="get">
		UserId:<input type="text" name="userId" value=""></input>
   <input id="querysubmit" type="button" value="查询"></input>
   </form>
<p id="resultTextarea"></p>
</fieldset>
<fieldset>
   <legend>删除常用联系人</legend>
   <form id="deleteForm" method="post">
		联系人UserId:<input type="text" name="ids" value=""></input>
		联系人UserId:<input type="text" name="ids" value=""></input>
		联系人UserId:<input type="text" name="ids" value=""></input>
		联系人UserId:<input type="text" name="ids" value=""></input>
		联系人UserId:<input type="text" name="ids" value=""></input>
		<input id="deletesubmit" type="button" value="删除"></input>
	</form>
</fieldset>	
	
</body>
</html>
